package club.justwill.single.persistence.document;

import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by luoyu on 1/18/16.
 */
@Document(collection = "user_follow_project")
public class UserFollowProject extends MongoDocument{
    @Field("user_id")
    private long userId;

    @Field("followed_project_id_list")
    private List<Long> followedProjectIdList;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public List<Long> getFollowedProjectIdList() {
        if(followedProjectIdList == null) {
            followedProjectIdList = new ArrayList<Long>();
        }
        return followedProjectIdList;
    }

    public void setFollowedProjectIdList(List<Long> followedProjectIdList) {
        this.followedProjectIdList = followedProjectIdList;
    }
}
